3.55 \(\int \frac {(a+b \log (c x^n))^2}{x^2} \, dx\)

Optimal. Leaf size=46 \[ -\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {2 b^2 n^2}{x} \]

[Out]

-2*b^2*n^2/x-2*b*n*(a+b*ln(c*x^n))/x-(a+b*ln(c*x^n))^2/x

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2305, 2304} \[ -\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {2 b^2 n^2}{x} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])^2/x^2,x]

[Out]

(-2*b^2*n^2)/x - (2*b*n*(a + b*Log[c*x^n]))/x - (a + b*Log[c*x^n])^2/x

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx &=-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}+(2 b n) \int \frac {a+b \log \left (c x^n\right )}{x^2} \, dx\\ &=-\frac {2 b^2 n^2}{x}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 35, normalized size = 0.76 \[ -\frac {\left (a+b \log \left (c x^n\right )\right )^2+2 b n \left (a+b \log \left (c x^n\right )+b n\right )}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])^2/x^2,x]

[Out]

-(((a + b*Log[c*x^n])^2 + 2*b*n*(a + b*n + b*Log[c*x^n]))/x)

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 77, normalized size = 1.67 \[ -\frac {b^{2} n^{2} \log \relax (x)^{2} + 2 \, b^{2} n^{2} + b^{2} \log \relax (c)^{2} + 2 \, a b n + a^{2} + 2 \, {\left (b^{2} n + a b\right )} \log \relax (c) + 2 \, {\left (b^{2} n^{2} + b^{2} n \log \relax (c) + a b n\right )} \log \relax (x)}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="fricas")

[Out]

-(b^2*n^2*log(x)^2 + 2*b^2*n^2 + b^2*log(c)^2 + 2*a*b*n + a^2 + 2*(b^2*n + a*b)*log(c) + 2*(b^2*n^2 + b^2*n*lo
g(c) + a*b*n)*log(x))/x

________________________________________________________________________________________

giac [A]  time = 0.31, size = 86, normalized size = 1.87 \[ -\frac {b^{2} n^{2} \log \relax (x)^{2}}{x} - \frac {2 \, {\left (b^{2} n^{2} + b^{2} n \log \relax (c) + a b n\right )} \log \relax (x)}{x} - \frac {2 \, b^{2} n^{2} + 2 \, b^{2} n \log \relax (c) + b^{2} \log \relax (c)^{2} + 2 \, a b n + 2 \, a b \log \relax (c) + a^{2}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="giac")

[Out]

-b^2*n^2*log(x)^2/x - 2*(b^2*n^2 + b^2*n*log(c) + a*b*n)*log(x)/x - (2*b^2*n^2 + 2*b^2*n*log(c) + b^2*log(c)^2
 + 2*a*b*n + 2*a*b*log(c) + a^2)/x

________________________________________________________________________________________

maple [C]  time = 0.17, size = 704, normalized size = 15.30 \[ -\frac {b^{2} \ln \left (x^{n}\right )^{2}}{x}-\frac {\left (-i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+i \pi \,b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-i \pi \,b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+2 b^{2} n +2 b^{2} \ln \relax (c )+2 a b \right ) \ln \left (x^{n}\right )}{x}-\frac {-\pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-4 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{4}-4 i \pi \,b^{2} n \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-4 i \pi \,b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3} \ln \relax (c )-4 i \pi a b \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+4 a^{2}+4 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi \,b^{2} n \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+4 i \pi \,b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+4 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi a b \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+8 b^{2} n^{2}-\pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}-\pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}+8 a b \ln \relax (c )+8 b^{2} n \ln \relax (c )+4 b^{2} \ln \relax (c )^{2}+8 a b n -\pi ^{2} b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{6}-4 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) \ln \relax (c )-4 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )-4 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i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csgn(I*x^n)*csgn(I*c*x^n)*ln(c)
-4*I*Pi*b^2*n*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+4*I*Pi*b^2*n*csgn(I*x^n)*csgn(I*c*x^n)^2-4*I*Pi*a*b*csgn(I*c
)*csgn(I*x^n)*csgn(I*c*x^n))/x

________________________________________________________________________________________

maxima [A]  time = 0.73, size = 70, normalized size = 1.52 \[ -2 \, b^{2} {\left (\frac {n^{2}}{x} + \frac {n \log \left (c x^{n}\right )}{x}\right )} - \frac {b^{2} \log \left (c x^{n}\right )^{2}}{x} - \frac {2 \, a b n}{x} - \frac {2 \, a b \log \left (c x^{n}\right )}{x} - \frac {a^{2}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="maxima")

[Out]

-2*b^2*(n^2/x + n*log(c*x^n)/x) - b^2*log(c*x^n)^2/x - 2*a*b*n/x - 2*a*b*log(c*x^n)/x - a^2/x

________________________________________________________________________________________

mupad [B]  time = 3.61, size = 56, normalized size = 1.22 \[ -\frac {a^2+2\,a\,b\,n+2\,b^2\,n^2}{x}-\frac {b^2\,{\ln \left (c\,x^n\right )}^2}{x}-\frac {2\,b\,\ln \left (c\,x^n\right )\,\left (a+b\,n\right )}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*x^n))^2/x^2,x)

[Out]

- (a^2 + 2*b^2*n^2 + 2*a*b*n)/x - (b^2*log(c*x^n)^2)/x - (2*b*log(c*x^n)*(a + b*n))/x

________________________________________________________________________________________

sympy [B]  time = 0.57, size = 110, normalized size = 2.39 \[ - \frac {a^{2}}{x} - \frac {2 a b n \log {\relax (x )}}{x} - \frac {2 a b n}{x} - \frac {2 a b \log {\relax (c )}}{x} - \frac {b^{2} n^{2} \log {\relax (x )}^{2}}{x} - \frac {2 b^{2} n^{2} \log {\relax (x )}}{x} - \frac {2 b^{2} n^{2}}{x} - \frac {2 b^{2} n \log {\relax (c )} \log {\relax (x )}}{x} - \frac {2 b^{2} n \log {\relax (c )}}{x} - \frac {b^{2} \log {\relax (c )}^{2}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))**2/x**2,x)

[Out]

-a**2/x - 2*a*b*n*log(x)/x - 2*a*b*n/x - 2*a*b*log(c)/x - b**2*n**2*log(x)**2/x - 2*b**2*n**2*log(x)/x - 2*b**
2*n**2/x - 2*b**2*n*log(c)*log(x)/x - 2*b**2*n*log(c)/x - b**2*log(c)**2/x

________________________________________________________________________________________